package com.ssy.lingxi.product.repository.platform;

import com.ssy.lingxi.product.entity.platform.AttributeValue;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 属性值持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/22
 */
public interface AttributeValueRepository extends JpaRepository<AttributeValue,Long>, JpaSpecificationExecutor<AttributeValue> {
    Page<AttributeValue> findByValueContainingAndIsEnableInAndAttributeIdOrderByIdDesc(String value, List<Boolean> enaList, Long attributeId, Pageable page);

    List<AttributeValue> findByAttributeIdAndValueAndIdNot(Long attributeId, String value, Long id);

    List<AttributeValue> findByAttributeIdAndValue(Long attributeId, String value);

    List<AttributeValue> findByAttributeId(Long attributeId);

    List<AttributeValue> findByIdIn(List<Long> idList);
}
